<!DOCTYPE html>
<html>
<head>
	<title>Netstat Parser</title>
<head>    
    <div id="myDiv1">Step 1 - Start By Choosing Files 
	    <input type="file" id="file" name="files[]" multiple />
     </div>
    
    <div id="myDiv2">run command netstat -b -a -o -n  </div>

	<script language="javascript" type="text/javascript" src="./netstat-parser1.js"></script>
    <script>
    	var files;
    
   
    	var divCounter=1;
        function handleFileSelect(evt) {
        	var files = evt.target.files; // FileList object
           	// files is a FileList of File objects. List some properties.
        	var output = [];
        	
        	for (var i = 0, f; f = files[i]; i++) {
            	var fname1=(f.name).split('_')[0];
            	console.log(fname1);
            	serverIpsDataContainer[fname1]={};

            	var reader = new FileReader();
            	var filetext;
            	//document.getElementById('myDiv2').innerHTML +="<h3>"+fname1+"</h3>";
            	reader.onload = (function(theFile) {
            		return function(e) {
            			FileHtmlDisplay=parseTextFile(e.target.result);
                    	
                    	//console.log(divCounter);
                    	document.getElementById('myDiv2').innerHTML += ('<ul>'+"<br>" +FileHtmlDisplay +"<br>"+ '</ul>');
                    	divCounter++;
            		};
          		})(f);
	           	reader.readAsText(f);
        	}
	        //document.getElementById('list').innerHTML = '<ul>' + filetext + '</ul>';
	        //alert 
        }
	
		document.getElementById('file').addEventListener('change', handleFileSelect, false);
	        
    </script>

</body>
</html> 
